


//判断图片是否损坏
function imgError(){
    var img = event.srcElement;
    img.src = "https://mms0.baidu.com/it/u=1402893264,594888051&fm=15&gp=0.jpg&fmt=auto";
    img.onerror = null; //控制不要一直跳动
}
//全部
$('.software_nav .all').addClass('software_active')
$('body').on('click','.software_nav .all',function(){
    $('.software_nav ul li').removeClass('software_active')
    $(this).addClass('software_active')
})
//点击左侧导航
$('body').on('click','.software_nav ul li',function(){
    var data_id = $(this).attr('data-id')
    $('.software_nav .all').removeClass('software_active')
    $('.software_nav ul li').removeClass('software_active')
    $(this).addClass('software_active')
})

//搜索
$('body').on('click','.header_ipt',function(){
    $(this).val('');
});
$('body').on('click','.header_btn',function(){
    // alert(2727);
    var text = $('.header_ipt').val();
    var url_str = "/index/sort/index?name="+text;
    window.location.href = url_str;

});
//回车事件绑定
$('.header_ipt').bind('keyup', function(event) {
    if (event.keyCode == 13) {
        var text = $(this).val();
        var url_str = "/index/sort/index?name="+text;
        window.location.href = url_str;
    }
});

$(function(){
      //轮播图
      var mySwiper = new Swiper('.mn-swiper', {
        pagination : '.pagination',
        autoplay : 5000,//可选选项，自动滑动
        loop : true,//可选选项，开启循环
        paginationClickable:true
    })
   //--  如果需要前进后退按钮 --
    // $('.arrow-left').click(function(){
    //     mySwiper.swipePrev();
    // });
    // $('.arrow-right').click(function(){
    //     mySwiper.swipeNext();
    // });
    //鼠标移入悬停
    $('.swiper-container').on('mouseenter', function(){
        mySwiper.stopAutoplay();
    })
    //鼠标移出滚动
    $('.swiper-container').on('mouseleave', function(){
        mySwiper.startAutoplay();
    })
})
